.class public Lrexsee/multimedia/RexseeVideoCapture;
.super Ljava/lang/Object;
.source "RexseeVideoCapture.java"

# interfaces
.implements Lrexsee/core/browser/clazz/JavascriptInterface;


# static fields
.field public static final EVENT_ONVIDEOCAPTUREINFO:Ljava/lang/String; = "onVideoCaptureInfo"

.field private static final INTERFACE_NAME:Ljava/lang/String; = "VideoCapture"


# instance fields
.field private final mBrowser:Lrexsee/core/browser/Browser;

.field private final mCaptureArguments:Lrexsee/multimedia/MediaCaptureArguments;

.field private final mErrorListener:Landroid/media/MediaRecorder$OnErrorListener;

.field private final mInfoListener:Landroid/media/MediaRecorder$OnInfoListener;

.field private mRecorder:Landroid/media/MediaRecorder;

.field private mSurfaceDialog:Lrexsee/multimedia/SurfaceDialog;


# direct methods
.method public constructor <init>(Lrexsee/core/browser/Browser;)V
    .locals 2
    .param p1, "browser"    # Lrexsee/core/browser/Browser;

    .prologue
    const/4 v0, 0x0

    .line 64
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 35
    iput-object v0, p0, Lrexsee/multimedia/RexseeVideoCapture;->mSurfaceDialog:Lrexsee/multimedia/SurfaceDialog;

    .line 36
    iput-object v0, p0, Lrexsee/multimedia/RexseeVideoCapture;->mRecorder:Landroid/media/MediaRecorder;

    .line 38
    new-instance v0, Lrexsee/multimedia/RexseeVideoCapture$1;

    invoke-direct {v0, p0}, Lrexsee/multimedia/RexseeVideoCapture$1;-><init>(Lrexsee/multimedia/RexseeVideoCapture;)V

    iput-object v0, p0, Lrexsee/multimedia/RexseeVideoCapture;->mErrorListener:Landroid/media/MediaRecorder$OnErrorListener;

    .line 44
    new-instance v0, Lrexsee/multimedia/RexseeVideoCapture$2;

    invoke-direct {v0, p0}, Lrexsee/multimedia/RexseeVideoCapture$2;-><init>(Lrexsee/multimedia/RexseeVideoCapture;)V

    iput-object v0, p0, Lrexsee/multimedia/RexseeVideoCapture;->mInfoListener:Landroid/media/MediaRecorder$OnInfoListener;

    .line 65
    iput-object p1, p0, Lrexsee/multimedia/RexseeVideoCapture;->mBrowser:Lrexsee/core/browser/Browser;

    .line 66
    new-instance v0, Lrexsee/multimedia/MediaCaptureArguments;

    invoke-direct {v0}, Lrexsee/multimedia/MediaCaptureArguments;-><init>()V

    iput-object v0, p0, Lrexsee/multimedia/RexseeVideoCapture;->mCaptureArguments:Lrexsee/multimedia/MediaCaptureArguments;

    .line 67
    iget-object v0, p0, Lrexsee/multimedia/RexseeVideoCapture;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v0, v0, Lrexsee/core/browser/Browser;->eventList:Lrexsee/core/browser/clazz/EventList;

    const-string v1, "onVideoCaptureInfo"

    invoke-virtual {v0, v1}, Lrexsee/core/browser/clazz/EventList;->add(Ljava/lang/String;)V

    .line 68
    return-void
.end method

.method static synthetic access$0(Lrexsee/multimedia/RexseeVideoCapture;)Lrexsee/core/browser/Browser;
    .locals 1

    .prologue
    .line 32
    iget-object v0, p0, Lrexsee/multimedia/RexseeVideoCapture;->mBrowser:Lrexsee/core/browser/Browser;

    return-object v0
.end method

.method static synthetic access$1(Lrexsee/multimedia/RexseeVideoCapture;)Lrexsee/multimedia/MediaCaptureArguments;
    .locals 1

    .prologue
    .line 33
    iget-object v0, p0, Lrexsee/multimedia/RexseeVideoCapture;->mCaptureArguments:Lrexsee/multimedia/MediaCaptureArguments;

    return-object v0
.end method

.method static synthetic access$2(Lrexsee/multimedia/RexseeVideoCapture;)Landroid/media/MediaRecorder$OnErrorListener;
    .locals 1

    .prologue
    .line 38
    iget-object v0, p0, Lrexsee/multimedia/RexseeVideoCapture;->mErrorListener:Landroid/media/MediaRecorder$OnErrorListener;

    return-object v0
.end method

.method static synthetic access$3(Lrexsee/multimedia/RexseeVideoCapture;)Landroid/media/MediaRecorder$OnInfoListener;
    .locals 1

    .prologue
    .line 44
    iget-object v0, p0, Lrexsee/multimedia/RexseeVideoCapture;->mInfoListener:Landroid/media/MediaRecorder$OnInfoListener;

    return-object v0
.end method

.method static synthetic access$4(Lrexsee/multimedia/RexseeVideoCapture;Landroid/media/MediaRecorder;)V
    .locals 0

    .prologue
    .line 36
    iput-object p1, p0, Lrexsee/multimedia/RexseeVideoCapture;->mRecorder:Landroid/media/MediaRecorder;

    return-void
.end method

.method static synthetic access$5(Lrexsee/multimedia/RexseeVideoCapture;)Landroid/media/MediaRecorder;
    .locals 1

    .prologue
    .line 36
    iget-object v0, p0, Lrexsee/multimedia/RexseeVideoCapture;->mRecorder:Landroid/media/MediaRecorder;

    return-object v0
.end method


# virtual methods
.method public getArguments()Ljava/lang/String;
    .locals 2

    .prologue
    .line 191
    iget-object v0, p0, Lrexsee/multimedia/RexseeVideoCapture;->mCaptureArguments:Lrexsee/multimedia/MediaCaptureArguments;

    const/4 v1, 0x1

    invoke-virtual {v0, v1}, Lrexsee/multimedia/MediaCaptureArguments;->toString(Z)Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getInheritInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 0
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 23
    return-object p0
.end method

.method public getInterfaceName()Ljava/lang/String;
    .locals 2

    .prologue
    .line 19
    new-instance v0, Ljava/lang/StringBuilder;

    iget-object v1, p0, Lrexsee/multimedia/RexseeVideoCapture;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v1, v1, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    iget-object v1, v1, Lrexsee/core/application/RexseeApplication;->resources:Lrexsee/core/application/Resource;

    iget-object v1, v1, Lrexsee/core/application/Resource;->prefix:Ljava/lang/String;

    invoke-static {v1}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v1

    invoke-direct {v0, v1}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v1, "VideoCapture"

    invoke-virtual {v0, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v0

    invoke-virtual {v0}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v0

    return-object v0
.end method

.method public getNewInterface(Lrexsee/core/browser/Browser;)Lrexsee/core/browser/clazz/JavascriptInterface;
    .locals 1
    .param p1, "childBrowser"    # Lrexsee/core/browser/Browser;

    .prologue
    .line 27
    new-instance v0, Lrexsee/multimedia/RexseeVideoCapture;

    invoke-direct {v0, p1}, Lrexsee/multimedia/RexseeVideoCapture;-><init>(Lrexsee/core/browser/Browser;)V

    return-object v0
.end method

.method public setArguments(Ljava/lang/String;)V
    .locals 1
    .param p1, "argu"    # Ljava/lang/String;

    .prologue
    .line 194
    iget-object v0, p0, Lrexsee/multimedia/RexseeVideoCapture;->mCaptureArguments:Lrexsee/multimedia/MediaCaptureArguments;

    invoke-virtual {v0, p1}, Lrexsee/multimedia/MediaCaptureArguments;->parseArguments(Ljava/lang/String;)Lrexsee/multimedia/MediaCaptureArguments;

    .line 195
    return-void
.end method

.method public start(Ljava/lang/String;)Z
    .locals 9
    .param p1, "path"    # Ljava/lang/String;

    .prologue
    const/4 v8, 0x0

    .line 122
    invoke-static {p1}, Lrexsee/core/utilities/Utilities;->prepareWriteFile(Ljava/lang/String;)Ljava/io/File;

    move-result-object v2

    .line 123
    .local v2, "target":Ljava/io/File;
    if-nez v2, :cond_0

    .line 124
    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/multimedia/RexseeVideoCapture;->getInterfaceName()Ljava/lang/String;

    move-result-object v4

    const-string v5, "Invalid target file path."

    invoke-virtual {v3, v4, v5}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/String;)V

    move v3, v8

    .line 160
    :goto_0
    return v3

    .line 127
    :cond_0
    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-static {v3}, Lrexsee/multimedia/RexseeCameraPreview;->getPreview(Lrexsee/core/browser/Browser;)Lrexsee/multimedia/RexseeCameraPreview;

    move-result-object v1

    .line 128
    .local v1, "preview":Lrexsee/multimedia/RexseeCameraPreview;
    if-nez v1, :cond_1

    .line 129
    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/multimedia/RexseeVideoCapture;->getInterfaceName()Ljava/lang/String;

    move-result-object v4

    new-instance v5, Ljava/lang/StringBuilder;

    const-string v6, "Preview dialog is not ready, please call start(path,style) to start recording immediately or call "

    invoke-direct {v5, v6}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    iget-object v6, p0, Lrexsee/multimedia/RexseeVideoCapture;->mBrowser:Lrexsee/core/browser/Browser;

    iget-object v6, v6, Lrexsee/core/browser/Browser;->application:Lrexsee/core/application/RexseeApplication;

    iget-object v6, v6, Lrexsee/core/application/RexseeApplication;->resources:Lrexsee/core/application/Resource;

    iget-object v6, v6, Lrexsee/core/application/Resource;->prefix:Ljava/lang/String;

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    const-string v6, "CameraPreview"

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    const-string v6, ".start(style) to start preview dialog."

    invoke-virtual {v5, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v5

    invoke-virtual {v5}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v5

    invoke-virtual {v3, v4, v5}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/String;)V

    move v3, v8

    .line 130
    goto :goto_0

    .line 132
    :cond_1
    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mSurfaceDialog:Lrexsee/multimedia/SurfaceDialog;

    if-eqz v3, :cond_2

    .line 133
    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mSurfaceDialog:Lrexsee/multimedia/SurfaceDialog;

    invoke-virtual {v3}, Lrexsee/multimedia/SurfaceDialog;->dismiss()V

    .line 134
    const/4 v3, 0x0

    iput-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mSurfaceDialog:Lrexsee/multimedia/SurfaceDialog;

    .line 137
    :cond_2
    :try_start_0
    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mCaptureArguments:Lrexsee/multimedia/MediaCaptureArguments;

    invoke-virtual {v1}, Lrexsee/multimedia/RexseeCameraPreview;->getCamera()Landroid/hardware/Camera;

    move-result-object v4

    iget-object v5, v1, Lrexsee/multimedia/RexseeCameraPreview;->previewDialog:Lrexsee/multimedia/CameraPreviewDialog;

    iget-object v5, v5, Lrexsee/multimedia/CameraPreviewDialog;->surfaceView:Landroid/view/SurfaceView;

    invoke-virtual {v5}, Landroid/view/SurfaceView;->getHolder()Landroid/view/SurfaceHolder;

    move-result-object v5

    iget-object v6, p0, Lrexsee/multimedia/RexseeVideoCapture;->mErrorListener:Landroid/media/MediaRecorder$OnErrorListener;

    iget-object v7, p0, Lrexsee/multimedia/RexseeVideoCapture;->mInfoListener:Landroid/media/MediaRecorder$OnInfoListener;

    invoke-virtual {v3, v4, v5, v6, v7}, Lrexsee/multimedia/MediaCaptureArguments;->getRecorder(Landroid/hardware/Camera;Landroid/view/SurfaceHolder;Landroid/media/MediaRecorder$OnErrorListener;Landroid/media/MediaRecorder$OnInfoListener;)Landroid/media/MediaRecorder;

    move-result-object v3

    iput-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mRecorder:Landroid/media/MediaRecorder;
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 143
    :try_start_1
    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mRecorder:Landroid/media/MediaRecorder;

    invoke-virtual {v2}, Ljava/io/File;->getAbsolutePath()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4}, Landroid/media/MediaRecorder;->setOutputFile(Ljava/lang/String;)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_1

    .line 149
    :try_start_2
    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mRecorder:Landroid/media/MediaRecorder;

    invoke-virtual {v3}, Landroid/media/MediaRecorder;->prepare()V
    :try_end_2
    .catch Ljava/lang/Exception; {:try_start_2 .. :try_end_2} :catch_2

    .line 155
    :try_start_3
    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mRecorder:Landroid/media/MediaRecorder;

    invoke-virtual {v3}, Landroid/media/MediaRecorder;->start()V
    :try_end_3
    .catch Ljava/lang/Exception; {:try_start_3 .. :try_end_3} :catch_3

    .line 160
    const/4 v3, 0x1

    goto :goto_0

    .line 138
    :catch_0
    move-exception v3

    move-object v0, v3

    .line 139
    .local v0, "e":Ljava/lang/Exception;
    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mBrowser:Lrexsee/core/browser/Browser;

    if-eqz v3, :cond_3

    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mBrowser:Lrexsee/core/browser/Browser;

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-virtual {p0}, Lrexsee/multimedia/RexseeVideoCapture;->getInterfaceName()Ljava/lang/String;

    move-result-object v5

    invoke-static {v5}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v4, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v5, ".getRecorder"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4, v0}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    :cond_3
    move v3, v8

    .line 140
    goto/16 :goto_0

    .line 144
    .end local v0    # "e":Ljava/lang/Exception;
    :catch_1
    move-exception v3

    move-object v0, v3

    .line 145
    .restart local v0    # "e":Ljava/lang/Exception;
    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mBrowser:Lrexsee/core/browser/Browser;

    if-eqz v3, :cond_4

    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mBrowser:Lrexsee/core/browser/Browser;

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-virtual {p0}, Lrexsee/multimedia/RexseeVideoCapture;->getInterfaceName()Ljava/lang/String;

    move-result-object v5

    invoke-static {v5}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v4, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v5, ".setOutputFile"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4, v0}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    :cond_4
    move v3, v8

    .line 146
    goto/16 :goto_0

    .line 150
    .end local v0    # "e":Ljava/lang/Exception;
    :catch_2
    move-exception v3

    move-object v0, v3

    .line 151
    .restart local v0    # "e":Ljava/lang/Exception;
    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mBrowser:Lrexsee/core/browser/Browser;

    if-eqz v3, :cond_5

    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mBrowser:Lrexsee/core/browser/Browser;

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-virtual {p0}, Lrexsee/multimedia/RexseeVideoCapture;->getInterfaceName()Ljava/lang/String;

    move-result-object v5

    invoke-static {v5}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v4, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v5, ".prepare"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4, v0}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    :cond_5
    move v3, v8

    .line 152
    goto/16 :goto_0

    .line 156
    .end local v0    # "e":Ljava/lang/Exception;
    :catch_3
    move-exception v3

    move-object v0, v3

    .line 157
    .restart local v0    # "e":Ljava/lang/Exception;
    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mBrowser:Lrexsee/core/browser/Browser;

    if-eqz v3, :cond_6

    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mBrowser:Lrexsee/core/browser/Browser;

    new-instance v4, Ljava/lang/StringBuilder;

    invoke-virtual {p0}, Lrexsee/multimedia/RexseeVideoCapture;->getInterfaceName()Ljava/lang/String;

    move-result-object v5

    invoke-static {v5}, Ljava/lang/String;->valueOf(Ljava/lang/Object;)Ljava/lang/String;

    move-result-object v5

    invoke-direct {v4, v5}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    const-string v5, ".start"

    invoke-virtual {v4, v5}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v4

    invoke-virtual {v4}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4, v0}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    :cond_6
    move v3, v8

    .line 158
    goto/16 :goto_0
.end method

.method public start(Ljava/lang/String;Ljava/lang/String;)Z
    .locals 7
    .param p1, "path"    # Ljava/lang/String;
    .param p2, "style"    # Ljava/lang/String;

    .prologue
    const/4 v6, 0x0

    .line 74
    invoke-static {p1}, Lrexsee/core/utilities/Utilities;->prepareWriteFile(Ljava/lang/String;)Ljava/io/File;

    move-result-object v2

    .line 75
    .local v2, "target":Ljava/io/File;
    if-nez v2, :cond_0

    .line 76
    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/multimedia/RexseeVideoCapture;->getInterfaceName()Ljava/lang/String;

    move-result-object v4

    const-string v5, "Invalid target file path."

    invoke-virtual {v3, v4, v5}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/String;)V

    move v3, v6

    .line 117
    :goto_0
    return v3

    .line 79
    :cond_0
    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mSurfaceDialog:Lrexsee/multimedia/SurfaceDialog;

    if-eqz v3, :cond_1

    .line 80
    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mSurfaceDialog:Lrexsee/multimedia/SurfaceDialog;

    invoke-virtual {v3}, Lrexsee/multimedia/SurfaceDialog;->dismiss()V

    .line 81
    const/4 v3, 0x0

    iput-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mSurfaceDialog:Lrexsee/multimedia/SurfaceDialog;

    .line 83
    :cond_1
    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-static {v3}, Lrexsee/multimedia/RexseeCameraPreview;->getPreview(Lrexsee/core/browser/Browser;)Lrexsee/multimedia/RexseeCameraPreview;

    move-result-object v1

    .line 84
    .local v1, "preview":Lrexsee/multimedia/RexseeCameraPreview;
    if-eqz v1, :cond_2

    invoke-virtual {v1}, Lrexsee/multimedia/RexseeCameraPreview;->stop()Z

    .line 86
    :cond_2
    :try_start_0
    new-instance v3, Lrexsee/multimedia/SurfaceDialog;

    iget-object v4, p0, Lrexsee/multimedia/RexseeVideoCapture;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-direct {v3, v4, p2}, Lrexsee/multimedia/SurfaceDialog;-><init>(Lrexsee/core/browser/Browser;Ljava/lang/String;)V

    iput-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mSurfaceDialog:Lrexsee/multimedia/SurfaceDialog;

    .line 87
    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mSurfaceDialog:Lrexsee/multimedia/SurfaceDialog;

    new-instance v4, Lrexsee/multimedia/RexseeVideoCapture$3;

    invoke-direct {v4, p0, v2}, Lrexsee/multimedia/RexseeVideoCapture$3;-><init>(Lrexsee/multimedia/RexseeVideoCapture;Ljava/io/File;)V

    invoke-virtual {v3, v4}, Lrexsee/multimedia/SurfaceDialog;->start(Landroid/view/SurfaceHolder$Callback;)V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_0

    .line 114
    const/4 v3, 0x1

    goto :goto_0

    .line 115
    :catch_0
    move-exception v3

    move-object v0, v3

    .line 116
    .local v0, "e":Ljava/lang/Exception;
    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mBrowser:Lrexsee/core/browser/Browser;

    if-eqz v3, :cond_3

    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/multimedia/RexseeVideoCapture;->getInterfaceName()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4, v0}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    :cond_3
    move v3, v6

    .line 117
    goto :goto_0
.end method

.method public stop()Z
    .locals 6

    .prologue
    const/4 v4, 0x0

    const/4 v5, 0x0

    .line 163
    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mSurfaceDialog:Lrexsee/multimedia/SurfaceDialog;

    if-eqz v3, :cond_0

    .line 164
    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mSurfaceDialog:Lrexsee/multimedia/SurfaceDialog;

    invoke-virtual {v3}, Lrexsee/multimedia/SurfaceDialog;->dismiss()V

    .line 165
    iput-object v4, p0, Lrexsee/multimedia/RexseeVideoCapture;->mSurfaceDialog:Lrexsee/multimedia/SurfaceDialog;

    .line 167
    :cond_0
    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-static {v3}, Lrexsee/multimedia/RexseeCameraPreview;->getPreview(Lrexsee/core/browser/Browser;)Lrexsee/multimedia/RexseeCameraPreview;

    move-result-object v1

    .line 168
    .local v1, "preview":Lrexsee/multimedia/RexseeCameraPreview;
    if-eqz v1, :cond_3

    .line 169
    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mRecorder:Landroid/media/MediaRecorder;

    if-eqz v3, :cond_1

    .line 171
    :try_start_0
    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mRecorder:Landroid/media/MediaRecorder;

    invoke-virtual {v3}, Landroid/media/MediaRecorder;->stop()V

    .line 172
    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mRecorder:Landroid/media/MediaRecorder;

    invoke-virtual {v3}, Landroid/media/MediaRecorder;->release()V
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    .line 175
    :goto_0
    iput-object v4, p0, Lrexsee/multimedia/RexseeVideoCapture;->mRecorder:Landroid/media/MediaRecorder;

    .line 179
    :cond_1
    :try_start_1
    const-class v3, Landroid/hardware/Camera;

    const-string v4, "reconnect"

    invoke-static {v3, v4}, Lrexsee/core/utilities/RexseeClazz;->getMethod(Ljava/lang/Class;Ljava/lang/String;)Ljava/lang/reflect/Method;

    move-result-object v2

    .line 180
    .local v2, "reconnect":Ljava/lang/reflect/Method;
    if-eqz v2, :cond_2

    invoke-virtual {v1}, Lrexsee/multimedia/RexseeCameraPreview;->getCamera()Landroid/hardware/Camera;

    move-result-object v3

    const/4 v4, 0x0

    new-array v4, v4, [Ljava/lang/Object;

    invoke-virtual {v2, v3, v4}, Ljava/lang/reflect/Method;->invoke(Ljava/lang/Object;[Ljava/lang/Object;)Ljava/lang/Object;

    .line 181
    :cond_2
    invoke-virtual {v1}, Lrexsee/multimedia/RexseeCameraPreview;->getCamera()Landroid/hardware/Camera;

    move-result-object v3

    iget-object v4, v1, Lrexsee/multimedia/RexseeCameraPreview;->previewDialog:Lrexsee/multimedia/CameraPreviewDialog;

    iget-object v4, v4, Lrexsee/multimedia/CameraPreviewDialog;->surfaceView:Landroid/view/SurfaceView;

    invoke-virtual {v4}, Landroid/view/SurfaceView;->getHolder()Landroid/view/SurfaceHolder;

    move-result-object v4

    invoke-virtual {v3, v4}, Landroid/hardware/Camera;->setPreviewDisplay(Landroid/view/SurfaceHolder;)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    .line 187
    .end local v2    # "reconnect":Ljava/lang/reflect/Method;
    :cond_3
    const/4 v3, 0x1

    :goto_1
    return v3

    .line 182
    :catch_0
    move-exception v3

    move-object v0, v3

    .line 183
    .local v0, "e":Ljava/lang/Exception;
    iget-object v3, p0, Lrexsee/multimedia/RexseeVideoCapture;->mBrowser:Lrexsee/core/browser/Browser;

    invoke-virtual {p0}, Lrexsee/multimedia/RexseeVideoCapture;->getInterfaceName()Ljava/lang/String;

    move-result-object v4

    invoke-virtual {v3, v4, v0}, Lrexsee/core/browser/Browser;->exception(Ljava/lang/String;Ljava/lang/Exception;)V

    move v3, v5

    .line 184
    goto :goto_1

    .line 173
    .end local v0    # "e":Ljava/lang/Exception;
    :catch_1
    move-exception v3

    goto :goto_0
.end method
